<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <th:block th:include="include :: datetimepicker-css" />

    <!-- 引入刚刚下载的 ECharts 文件 -->
<!--    <script th:src="@{/ajax/libs/report/echarts/echarts-all.min.js}"></script>-->
    <th:block th:include="include :: echarts-js" />
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />

</head>

<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 600px;height:400px;"></div>
</body>

<script th:inline="javascript">
    var prefix = ctx + "quantify"

    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '收益统计'
        },
        tooltip: {},
        legend: {
            data: ['收益']
        },
        xAxis: {
            data: []
        },
        yAxis: {},
        series: [
            {
                name: '收益',
                type: 'line',
                data: []
            }
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
    myChart.showLoading();    //数据加载完之前先显示一段简单的loading动画



    $.ajax({
        type: "post",
        url: prefix + "/getPersonalView",
        data: {
            "aa": "aa"
        },
        success: function(data) {
            myChart.hideLoading();    //隐藏加载动画
            myChart.setOption({        //加载数据图表
                legend: {
                    data: ['收益']
                },
                xAxis: {
                    data: data.timeList
                },
                series: [{
                    // 根据名字对应到相应的系列
                    name: '收益',
                    data: data.profitList
                }]
            });
        }
    });



</script>


</html>